COPY --from=build /out/ /
COPY --from=src /src/tests-unit-container /tests
-# The default final container
-FROM $base
+# Override userspace
+FROM $base as rootfs
+# Remove the default binaries to ensure we're getting our overrides
RUN rpm -e --nodeps ostree{,-libs}
COPY --from=build /out/ /
+
+# The default final container, with also a regenerated
+# initramfs in case ostree-prepare-root changed.
+FROM rootfs
# https://docs.fedoraproject.org/en-US/bootc/initramfs/#_regenerating_the_initrd
# since we have ostree-prepare-root there
RUN set -x; kver=$(cd /usr/lib/modules && echo *); dracut -vf /usr/lib/modules/$kver/initramfs.img $kver
osid := `. /usr/lib/os-release && echo $ID`
# Build the container image from current sources
-build:
- podman build --jobs=4 -t localhost/ostree .
+build *ARGS:
+ podman build --jobs=4 -t localhost/ostree {{ARGS}} .
-build-unittest:
- podman build --jobs=4 --target build -t localhost/ostree-buildroot .
+build-unittest *ARGS:
+ podman build --jobs=4 --target build -t localhost/ostree-buildroot {{ARGS}} .
+
+# Do a build but don't regenerate the initramfs
+build-noinitramfs *ARGS:
+ podman build --jobs=4 --target rootfs -t localhost/ostree {{ARGS}} .
# We need a filesystem that supports O_TMPFILE right now (i.e. not overlayfs)
# or ostree hard crashes in the http code =/
# need cap-add=all for mounting
podman run --rm --net=none {{unitpriv}} {{unittest_args}} --cap-add=all --env=TEST_CONTAINER=1 localhost/ostree-bintest /tests/run.sh
+# Run a build on the host system
+build-host:
+ . ci/libbuild.sh && build
+
+# Run a build on the host system and "install" into target/inst
+# This directory tree can then be copied elsewhere
+build-host-inst: build-host
+ make -C target/c install DESTDIR=$(pwd)/target/inst
+ tar --sort=name --numeric-owner --owner=0 --group=0 -C target/inst -czf target/inst.tar.gz .
+